<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加品牌</title>
</head>
<body>
<h3>添加品牌</h3>
<form action="" method="post">
    品牌名称：<input id="brandName" name="brandName"><br>
    企业名称：<input id="companyName" name="companyName"><br>
    排序：<input id="ordered" name="ordered"><br>
    描述信息：<textarea rows="5" cols="20" id="description" name="description"></textarea><br>
    状态：
    <input type="radio" name="status" value="0">禁用
    <input type="radio" name="status" value="1">启用<br>

    <input type="button" id="btn" value="提交">

</form>

<script src="js/axios-0.18.0.js"></script>

<script>
    //1.给按钮绑定单击事件
    document.getElementById("btn").onclick = function (){
        //2.发送ajax请求
        axios({
            method:"post",   //增删改一般用post，查一般用get
            url:"http://localhost:8080/brand-demo/addServlet",
            data:{brandName:"华为"}
            //这里data格式是javascript对象,但是axious会自动将javascript对象转为json对象
        }).then(function (resp){

        })
    }

</script>
</body>
</html>